package com.wxzhou.wangzhuan.entity;

/**
 * 广告类型
 */
public enum AdType {
    SPLASH(0, "开屏"),
    CP(1, "插屏"),
    JLSP(2, "激励视频"),
    XXL(3, "信息流"),
    BANNER(4, "横幅"),
    OTHER(5, "其他");


    private final int code;
    private final String description;

    AdType(int code, String description) {
        this.code = code;
        this.description = description;
    }

    public int getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    public static AdType fromCode(int code) {
        for (AdType status : values()) {
            if (status.code == code) {
                return status;
            }
        }
        throw new IllegalArgumentException("Unknown ad sense code: " + code);
    }

}
